
function Animal( type ){
    this.type = type ;
}

// 重写了 Object.prototype.toString
Animal.prototype.toString = function(){
    return '这是' + this.type + '类动物';
}

let a = new Animal( '禽' );
console.log( a.toString() );

function Birds( name ){
    this.name = name ;
}
Birds.prototype = new Animal( '禽' ) ;
Birds.prototype.constructor = Birds ;

Birds.prototype.toString = function( x , y , z ){
    console.log( x , y , z );
    return '这是' + this.type + '类动物，名字叫' + this.name ;
}

let b = new Birds( '啄木鸟' );
console.log( b.toString() );
console.log( b.toString( 2 , 5 , 0 ) );